/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved.
 *
 */

import { BuildProfileSchemaFileConst, ConfigSchemaFileConst } from '../../../const/common-const.js';
import { ModuleBuildProfile } from '../../../options/build/module-build-profile.js';

import { AbstractBuildProfileLoader } from './abstract-build-profile-loader.js';

class HarModuleBuildProfileLoader extends AbstractBuildProfileLoader {
  getBuildProfile(nodeName: string): ModuleBuildProfile.ModuleBuildOpt {
    return this.getBuildProfileJson5Obj(nodeName);
  }

  public setBuildProfileJson5Obj(hvigorNodeName: string, buildProfileJson5Obj: ModuleBuildProfile.ModuleBuildOpt, schemaCheck = true): void {
    super.setBuildProfileJson5ObjCheck(
      hvigorNodeName,
      buildProfileJson5Obj,
      schemaCheck ? BuildProfileSchemaFileConst.HAR_MODULE_BUILD_PROFILE_SCHEMA_PATH : undefined,
    );
  }
}

export const harModuleBuildProfileLoader = new HarModuleBuildProfileLoader();
